package drds.binlog.protocol.entry_protocol_proto;

/**
 * <pre>
 * * 事件类型 *
 * </pre>
 * <p>
 * Protobuf enum {@code com.alibaba.otter.canal.protocol.EventType}
 */
public enum EventType
        implements com.google.protobuf.ProtocolMessageEnum
{
    /**
     * <code>EVENTTYPECOMPATIBLEPROTO2 = 0;</code>
     */
    EVENTTYPECOMPATIBLEPROTO2(0),
    /**
     * <code>INSERT = 1;</code>
     */
    INSERT(1),
    /**
     * <code>UPDATE = 2;</code>
     */
    UPDATE(2),
    /**
     * <code>DELETE = 3;</code>
     */
    DELETE(3),
    /**
     * <code>CREATE = 4;</code>
     */
    CREATE(4),
    /**
     * <code>ALTER = 5;</code>
     */
    ALTER(5),
    /**
     * <code>ERASE = 6;</code>
     */
    ERASE(6),
    /**
     * <code>QUERY = 7;</code>
     */
    QUERY(7),
    /**
     * <code>TRUNCATE = 8;</code>
     */
    TRUNCATE(8),
    /**
     * <code>RENAME = 9;</code>
     */
    RENAME(9),
    /**
     * <pre>
     * *CREATE INDEX*
     * </pre>
     * <p>
     * <code>CINDEX = 10;</code>
     */
    CINDEX(10),
    /**
     * <code>DINDEX = 11;</code>
     */
    DINDEX(11),
    /**
     * <code>GTID = 12;</code>
     */
    GTID(12),
    /**
     * <pre>
     * * XA *
     * </pre>
     * <p>
     * <code>XACOMMIT = 13;</code>
     */
    XACOMMIT(13),
    /**
     * <code>XAROLLBACK = 14;</code>
     */
    XAROLLBACK(14),
    /**
     * <pre>
     * * MASTER HEARTBEAT *
     * </pre>
     * <p>
     * <code>MHEARTBEAT = 15;</code>
     */
    MHEARTBEAT(15),
    UNRECOGNIZED(-1),;

    /**
     * <code>EVENTTYPECOMPATIBLEPROTO2 = 0;</code>
     */
    public static final int EVENTTYPECOMPATIBLEPROTO2_VALUE = 0;
    /**
     * <code>INSERT = 1;</code>
     */
    public static final int INSERT_VALUE = 1;
    /**
     * <code>UPDATE = 2;</code>
     */
    public static final int UPDATE_VALUE = 2;
    /**
     * <code>DELETE = 3;</code>
     */
    public static final int DELETE_VALUE = 3;
    /**
     * <code>CREATE = 4;</code>
     */
    public static final int CREATE_VALUE = 4;
    /**
     * <code>ALTER = 5;</code>
     */
    public static final int ALTER_VALUE = 5;
    /**
     * <code>ERASE = 6;</code>
     */
    public static final int ERASE_VALUE = 6;
    /**
     * <code>QUERY = 7;</code>
     */
    public static final int QUERY_VALUE = 7;
    /**
     * <code>TRUNCATE = 8;</code>
     */
    public static final int TRUNCATE_VALUE = 8;
    /**
     * <code>RENAME = 9;</code>
     */
    public static final int RENAME_VALUE = 9;
    /**
     * <pre>
     * *CREATE INDEX*
     * </pre>
     * <p>
     * <code>CINDEX = 10;</code>
     */
    public static final int CINDEX_VALUE = 10;
    /**
     * <code>DINDEX = 11;</code>
     */
    public static final int DINDEX_VALUE = 11;
    /**
     * <code>GTID = 12;</code>
     */
    public static final int GTID_VALUE = 12;
    /**
     * <pre>
     * * XA *
     * </pre>
     * <p>
     * <code>XACOMMIT = 13;</code>
     */
    public static final int XACOMMIT_VALUE = 13;
    /**
     * <code>XAROLLBACK = 14;</code>
     */
    public static final int XAROLLBACK_VALUE = 14;
    /**
     * <pre>
     * * MASTER HEARTBEAT *
     * </pre>
     * <p>
     * <code>MHEARTBEAT = 15;</code>
     */
    public static final int MHEARTBEAT_VALUE = 15;
    private static final com.google.protobuf.Internal.EnumLiteMap<
            EventType> internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<EventType>()
            {
                public EventType findValueByNumber(int number)
                {
                    return EventType.forNumber(number);
                }
            };
    private static final EventType[] VALUES = values();
    private final int value;

    private EventType(int value)
    {
        this.value = value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @Deprecated
    public static EventType valueOf(int value)
    {
        return forNumber(value);
    }

    public static EventType forNumber(int value)
    {
        switch (value)
        {
            case 0:
                return EVENTTYPECOMPATIBLEPROTO2;
            case 1:
                return INSERT;
            case 2:
                return UPDATE;
            case 3:
                return DELETE;
            case 4:
                return CREATE;
            case 5:
                return ALTER;
            case 6:
                return ERASE;
            case 7:
                return QUERY;
            case 8:
                return TRUNCATE;
            case 9:
                return RENAME;
            case 10:
                return CINDEX;
            case 11:
                return DINDEX;
            case 12:
                return GTID;
            case 13:
                return XACOMMIT;
            case 14:
                return XAROLLBACK;
            case 15:
                return MHEARTBEAT;
            default:
                return null;
        }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<EventType>
    internalGetValueMap()
    {
        return internalValueMap;
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptor()
    {
        return BinlogEntry.getDescriptor().getEnumTypes().get(1);
    }

    public static EventType valueOf(
            com.google.protobuf.Descriptors.EnumValueDescriptor desc)
    {
        if (desc.getType() != getDescriptor())
        {
            throw new IllegalArgumentException(
                    "EnumValueDescriptor is not for this type.");
        }
        if (desc.getIndex() == -1)
        {
            return UNRECOGNIZED;
        }
        return VALUES[desc.getIndex()];
    }

    public final int getNumber()
    {
        if (this == UNRECOGNIZED)
        {
            throw new IllegalArgumentException(
                    "Can't get the number of an unknown enum value.");
        }
        return value;
    }

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
    getValueDescriptor()
    {
        return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptorForType()
    {
        return getDescriptor();
    }

    // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.EventType)
}
